#ifndef __TEXT_DIFF_H__
#define __TEXT_DIFF_H__

#include "..\Common\Utility.h"

namespace TextDiffAlgo
{
	class TextDiff {
	public:
		enum DiffType {
			TYPE_DELETED			= 0x102,
			TYPE_INSERTED			= 0x103,
			TYPE_SAME_BEFORE		= 0x104,
			TYPE_SAME_AFTER			= 0x105,
		};

	private:
		DiffType					m_DiffType;
		int							m_DiffStartIndex;
		int							m_DiffLength;

	public:
									TextDiff() { }
									TextDiff(DiffType in_DiffType, int in_DiffStartIndex, int in_DiffLength);

		DiffType					getDiffType() const { return m_DiffType; }
		void						setDiffType(DiffType in_DiffType);

		int							getDiffStartIndex() const { return m_DiffStartIndex; }
		void						setDiffStartIndex(int in_DiffStartIndex) { m_DiffStartIndex = in_DiffStartIndex; }

		int							getDiffLength() const { return m_DiffLength; }
		void						setDiffLength(int in_DiffLength) { m_DiffLength = in_DiffLength; }

		bool						operator<(const TextDiff &b) const { return this->m_DiffStartIndex < b.getDiffStartIndex(); }

		std::string					toString();

		int							compareTo(const TextDiff& comp);
	};
}

#endif ///> end of __TEXT_DIFF_H__